import threading
from time import sleep, time


class GetDetail(threading.Thread):

    def __init__(self, name):
        super().__init__(name=name)

    def run(self):
        print('this is start get get_url_detail !')
        sleep(1)
        print('this is end get get_url_detail !')


class GetContent(threading.Thread):
    def __init__(self, name):
        super().__init__(name=name)

    def run(self):
        print('this is start get get_content_url !')
        sleep(4)
        print('this is end get get_content_url !')


if __name__ == '__main__':
    start_time = time()
    print('this is the main Thread start At:[{}]'.format(start_time))
    t1 = GetDetail(name="get_detail_url")
    t2 = GetContent(name="get_content_url")
    # t1.setDaemon(True)
    # t2.setDaemon(True)
    t1.start()
    t2.start()
    t1.join()
    t2.join()
    print('this is the main thread is end At:[{}]'.format(time() - start_time))
